package so.sao.code.service.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;
import so.sao.code.service.domain.entity.LookupTable;


@Repository
public interface LookupTableDao extends JpaRepository<LookupTable, Long> {

    @Query(value = "SELECT * FROM lookup_table WHERE seqnum_start+lookup_table.current_count+?1<lookup_table.seqnum_end AND seqnum_start>=10000000000000000", nativeQuery = true)
    LookupTable findByBigSeq(Long tagCount);

    @Query(value = "SELECT * FROM lookup_table WHERE seqnum_start+lookup_table.current_count+?1<lookup_table.seqnum_end AND seqnum_start<10000000000000000", nativeQuery = true)
    LookupTable findBySmallSeq(Long tagCount);
}
